PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

ICL_LANGUAGE_CODE not working correctly

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi Pablo

I updated some plugins recently on my site and I got a Fatal error about the ICL_LANGUAGE_CODE in helper.php.

I checked the WPML forums and noticed that they suggested in some instances to use"wpml_current_language", therefore I've modified this piece of code in the following way:

"

if (class_exists('SitePress') OR class_exists("Polylang")) {
if (class_exists('SitePress')) {
//$lang = ICL_LANGUAGE_CODE;
$lang = apply_filters( 'wpml_current_language', NULL );
}
if (class_exists('Polylang')) {
$lang = get_locale();
}

"

With this change I have no fatal error anymore.

But could you confirm that this is correct and that this change will be included in the future versions of the plugin? Because otherwise I'm sure that at the next update I'll face the same fatal error again.

Thanks

Hello

Thank you  for  your  cooperation!

I will pass this to the developers

Perfect! Thanks.

Please let me know when you have some feedback from the developers.

Hello

Sure! The developers have already added this to the list of fixes

I will write to you as soon as we get the result

Hello

Update is done, fixed

Perfect! Thanks

Welcome;)